﻿using AspNetTraining.BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AspNetTraining
{
    public partial class Functionalitys : System.Web.UI.Page
    {
        FunctionalityManager fcmanager = new FunctionalityManager();
        public UserAccount SessionLogin
        {
            get
            {
                return (UserAccount)Session["LoggedUser"];
            }
            set
            {
                Session["LoggedUser"] = value;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (SessionLogin == null)
            {
                Response.Redirect("~/Account/Login.aspx");
            }
            if (!IsPostBack)
            {
                gvFunctionalitys.DataSource = fcmanager.GetListFunction();
                gvFunctionalitys.DataBind();
            }
        }
        protected String GetUserNameByID(object ID)
        {
            if (ID == null)
                return null;
            UserAccountManager user = new UserAccountManager();
            return user.GetUserNameByUserID(new Guid(ID.ToString()));
        }
        /// <summary>
        /// xoa nhieu dong
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void DeleteChoose_Click(object sender, EventArgs e)
        {

        }
    }
}